#ifndef SPRITE_OBJECT_H
#define SPRITE_OBJECT_H

#include "nds/arm9/sprite.h"
#include "nds/touch.h"
#include "main.h"

class SpriteObject{

/*
   Class: SpriteObject
   A class that manages a sprite object
*/
class SpriteObject {
public:
	/*
         Constructor: SpriteObject
         Initializes the object.
		 
		 Parameters:
		 &oam - OamState
		 size - The size of the sprite
		 colorFormat - The colorFormat of the sprite
    */
	SpriteObject(OamState * oam, SpriteSize size, SpriteColorFormat colorFormat);
	
	void stylusDown(touchPosition & touch);
	void stylusUp(touchPosition & touch);
	u8 stylus_is_over_opaque(touchPosition * touchPos, SpriteEntry * sprite);
	
	void set_position(coord coords);
	void reset_position();

	u16 * get_gfx_start_address();
	bool isHidden();
	u16 getX();
	u16 getY();

private:
	u8 id;
	u16* gfxStartAddress;
	SpriteEntry * sprite_entry;
	OamState * engine;
	bool is_dragged;
	coord origin;
	
	static u8 next_id[2];
};

#endif